package cz.cvut.fel.gfupan.gui.tab;

import cz.cvut.fel.gfupan.gui.MeasurePanel;
import cz.cvut.fel.gfupan.gui.Session;
import cz.cvut.fel.gfupan.gui.component.Button;
import cz.cvut.fel.gfupan.gui.component.TextField;
import cz.cvut.fel.gfupan.gui.execution.AutoFill;
import cz.cvut.fel.gfupan.gui.execution.Average;
import cz.cvut.fel.gfupan.gui.execution.Dummy;
import cz.cvut.fel.gfupan.gui.execution.Meridian;
import cz.cvut.fel.gfupan.gui.util.Coordinates;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import javax.swing.text.JTextComponent;

public class DeclinationTab extends AbstractTab {
    
    private MeasurePanel parent;
    
    public DeclinationTab(MeasurePanel parent) {
        this.parent = parent;
        initComponents();
        fill();
        actualCoords = new Coordinates(0, 0);
        
    }
    
    @Override
    public void setObservers() {
        //time
        addObserver(declinationMeasure1Hours, declinationAvgTimeHours);
        addObserver(declinationMeasure2Hours, declinationAvgTimeHours);
        addObserver(declinationMeasure3Hours, declinationAvgTimeHours);
        addObserver(declinationMeasure4Hours, declinationAvgTimeHours);
        setExecutor(declinationAvgTimeHours, new Average(declinationMeasure1Hours,
                declinationMeasure2Hours, declinationMeasure3Hours, declinationMeasure4Hours));
        
        addObserver(declinationMeasure1Minutes, declinationAvgTimeMinutes);
        addObserver(declinationMeasure2Minutes, declinationAvgTimeMinutes);
        addObserver(declinationMeasure3Minutes, declinationAvgTimeMinutes);
        addObserver(declinationMeasure4Minutes, declinationAvgTimeMinutes);
        setExecutor(declinationAvgTimeMinutes, new Average(declinationMeasure1Minutes,
                declinationMeasure2Minutes, declinationMeasure3Minutes, declinationMeasure4Minutes));
        
        addObserver(declinationMeasure1Seconds, declinationAvgTimeSeconds);
        addObserver(declinationMeasure2Seconds, declinationAvgTimeSeconds);
        addObserver(declinationMeasure3Seconds, declinationAvgTimeSeconds);
        addObserver(declinationMeasure4Seconds, declinationAvgTimeSeconds);
        setExecutor(declinationAvgTimeSeconds, new Average(declinationMeasure1Seconds,
                declinationMeasure2Seconds, declinationMeasure3Seconds, declinationMeasure4Seconds));

        //angles
        addObserver(declinationMeasure1Dd, declinationDeclinationDd);
        addObserver(declinationMeasure2Dd, declinationDeclinationDd);
        addObserver(declinationMeasure3Dd, declinationDeclinationDd);
        addObserver(declinationMeasure4Dd, declinationDeclinationDd);
        setExecutor(declinationDeclinationDd, new Average(declinationMeasure1Dd,
                declinationMeasure2Dd, declinationMeasure3Dd, declinationMeasure4Dd));
        
        addObserver(declinationMeasure1Mm, declinationDeclinationMm);
        addObserver(declinationMeasure2Mm, declinationDeclinationMm);
        addObserver(declinationMeasure3Mm, declinationDeclinationMm);
        addObserver(declinationMeasure4Mm, declinationDeclinationMm);
        setExecutor(declinationDeclinationMm, new Average(declinationMeasure1Mm,
                declinationMeasure2Mm, declinationMeasure3Mm, declinationMeasure4Mm));
        
        addObserver(declinationMeasure1Ss, declinationDeclinationSs);
        addObserver(declinationMeasure2Ss, declinationDeclinationSs);
        addObserver(declinationMeasure3Ss, declinationDeclinationSs);
        addObserver(declinationMeasure4Ss, declinationDeclinationSs);
        setExecutor(declinationDeclinationSs, new Average(declinationMeasure1Ss,
                declinationMeasure2Ss, declinationMeasure3Ss, declinationMeasure4Ss));
        
        addObserver(declinationDeclinationDd, declinationMeridianDd);
        setExecutor(declinationMeridianDd, new Meridian(declinationDeclinationDd));
        
        addObserver(declinationDeclinationMm, declinationMeridianMm);
        setExecutor(declinationMeridianMm, new Dummy(declinationDeclinationMm));
        
        addObserver(declinationDeclinationSs, declinationMeridianSs);
        setExecutor(declinationMeridianSs, new Dummy(declinationDeclinationSs));

        //autofill
        autoFillLoop(declinationMeasure1Hours, declinationMeasure2Hours, declinationMeasure3Hours, declinationMeasure4Hours);
        autoFillLoop(declinationMeasure1Minutes, declinationMeasure2Minutes, declinationMeasure3Minutes, declinationMeasure4Minutes);
        autoFillLoop(declinationMeasure1Seconds, declinationMeasure2Seconds, declinationMeasure3Seconds, declinationMeasure4Seconds);

        autoFillLoop(declinationMeasure1Dd, declinationMeasure2Dd, declinationMeasure3Dd, declinationMeasure4Dd);
        autoFillLoop(declinationMeasure1Mm, declinationMeasure2Mm, declinationMeasure3Mm, declinationMeasure4Mm);
        autoFillLoop(declinationMeasure1Ss, declinationMeasure2Ss, declinationMeasure3Ss, declinationMeasure4Ss);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        declination = new javax.swing.JPanel();
        fieldsPanel = new javax.swing.JPanel();
        declinationMeasure1Hours = new TextField(this);
        declinationMeasure1Minutes = new TextField(this);
        declinationMeasure1Seconds = new TextField(this);
        declinationMeasure2Hours = new TextField(this);
        declinationMeasure2Minutes = new TextField(this);
        declinationMeasure2Seconds = new TextField(this);
        declinationMeasure3Hours = new TextField(this);
        declinationMeasure3Minutes = new TextField(this);
        declinationMeasure3Seconds = new TextField(this);
        declinationMeasure4Hours = new TextField(this);
        declinationMeasure4Minutes = new TextField(this);
        declinationMeasure4Seconds = new TextField(this);
        declinationMeasure1 = new javax.swing.JLabel();
        declinationMeasure2 = new javax.swing.JLabel();
        declinationMeasure3 = new javax.swing.JLabel();
        declinationMeasure4 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        declinationAvgDeclination = new javax.swing.JLabel();
        declinationMeridian = new javax.swing.JLabel();
        declinationMeasure1Dd = new TextField(this);
        declinationMeasure1Mm = new TextField(this);
        declinationMeasure1Ss = new TextField(this);
        declinationMeasure2Dd = new TextField(this);
        declinationMeasure2Mm = new TextField(this);
        declinationMeasure2Ss = new TextField(this);
        declinationMeasure3Dd = new TextField(this);
        declinationMeasure3Mm = new TextField(this);
        declinationMeasure3Ss = new TextField(this);
        declinationMeasure4Dd = new TextField(this);
        declinationMeasure4Mm = new TextField(this);
        declinationMeasure4Ss = new TextField(this);
        declinationDeclinationDd = new TextField(this);
        declinationDeclinationMm = new TextField(this);
        declinationDeclinationSs = new TextField(this);
        declinationMeridianDd = new TextField(this);
        declinationMeridianMm = new TextField(this);
        declinationMeridianSs = new TextField(this);
        nowButton = new Button(this);
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        declinationAvgTime = new javax.swing.JLabel();
        declinationAvgTimeHours = new TextField(this);
        declinationAvgTimeMinutes = new TextField(this);
        declinationAvgTimeSeconds = new TextField(this);
        jSeparator5 = new javax.swing.JSeparator();
        backNextPanel = new javax.swing.JPanel();
        declinationBackButton = new Button(this);
        declinationNextButton = new Button(this);

        setPreferredSize(new java.awt.Dimension(531, 393));

        declination.setPreferredSize(new java.awt.Dimension(531, 393));

        java.util.ResourceBundle bundle = java.util.ResourceBundle.getBundle("cz/cvut/fel/gfupan/res/Bundle"); // NOI18N
        declinationMeasure1Hours.setText(bundle.getString("MeasurePanel.declinationMeasure1Time.text")); // NOI18N
        declinationMeasure1Hours.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure1Minutes.setText(bundle.getString("DeclinationTab.declinationMeasure1Minutes.text")); // NOI18N
        declinationMeasure1Minutes.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure1Seconds.setText(bundle.getString("DeclinationTab.declinationMeasure1Seconds.text")); // NOI18N
        declinationMeasure1Seconds.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure2Hours.setText(bundle.getString("DeclinationTab.declinationMeasure2Hours.text")); // NOI18N
        declinationMeasure2Hours.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure2Minutes.setText(bundle.getString("DeclinationTab.declinationMeasure2Minutes.text")); // NOI18N
        declinationMeasure2Minutes.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure2Seconds.setText(bundle.getString("DeclinationTab.declinationMeasure2Seconds.text")); // NOI18N
        declinationMeasure2Seconds.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure3Hours.setText(bundle.getString("DeclinationTab.declinationMeasure3Hours.text")); // NOI18N
        declinationMeasure3Hours.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure3Minutes.setText(bundle.getString("DeclinationTab.declinationMeasure3Minutes.text")); // NOI18N
        declinationMeasure3Minutes.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure3Seconds.setText(bundle.getString("DeclinationTab.declinationMeasure3Seconds.text")); // NOI18N
        declinationMeasure3Seconds.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure4Hours.setText(bundle.getString("DeclinationTab.declinationMeasure4Hours.text")); // NOI18N
        declinationMeasure4Hours.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure4Minutes.setText(bundle.getString("DeclinationTab.declinationMeasure4Minutes.text")); // NOI18N
        declinationMeasure4Minutes.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure4Seconds.setText(bundle.getString("DeclinationTab.declinationMeasure4Seconds.text")); // NOI18N
        declinationMeasure4Seconds.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationMeasure1.setText(bundle.getString("MeasurePanel.declinationMeasure1.text")); // NOI18N

        declinationMeasure2.setText(bundle.getString("MeasurePanel.declinationMeasure2.text")); // NOI18N

        declinationMeasure3.setText(bundle.getString("MeasurePanel.declinationMeasure3.text")); // NOI18N

        declinationMeasure4.setText(bundle.getString("MeasurePanel.declinationMeasure4.text")); // NOI18N

        jLabel5.setText(bundle.getString("DeclinationTab.jLabel5.text")); // NOI18N

        jLabel6.setText(bundle.getString("DeclinationTab.jLabel6.text")); // NOI18N

        jLabel7.setText(bundle.getString("DeclinationTab.jLabel7.text")); // NOI18N

        declinationAvgDeclination.setText(bundle.getString("MeasurePanel.declinationAvgDeclination.text")); // NOI18N

        declinationMeridian.setText(bundle.getString("MeasurePanel.declinationMeridian.text")); // NOI18N

        declinationMeasure1Dd.setText(bundle.getString("MeasurePanel.declinationMeasure1Dd.text")); // NOI18N

        declinationMeasure1Mm.setText(bundle.getString("MeasurePanel.declinationMeasure1Mm.text")); // NOI18N

        declinationMeasure1Ss.setText(bundle.getString("MeasurePanel.declinationMeasure1Ss.text")); // NOI18N

        declinationMeasure2Dd.setText(bundle.getString("MeasurePanel.declinationMeasure2Dd.text")); // NOI18N

        declinationMeasure2Mm.setText(bundle.getString("MeasurePanel.declinationMeasure2Mm.text")); // NOI18N

        declinationMeasure2Ss.setText(bundle.getString("MeasurePanel.declinationMeasure2Ss.text")); // NOI18N

        declinationMeasure3Dd.setText(bundle.getString("MeasurePanel.declinationMeasure3Dd.text")); // NOI18N

        declinationMeasure3Mm.setText(bundle.getString("MeasurePanel.declinationMeasure3Mm.text")); // NOI18N

        declinationMeasure3Ss.setText(bundle.getString("MeasurePanel.declinationMeasure3Ss.text")); // NOI18N

        declinationMeasure4Dd.setText(bundle.getString("MeasurePanel.declinationMeasure4Dd.text")); // NOI18N

        declinationMeasure4Mm.setText(bundle.getString("MeasurePanel.declinationMeasure4Mm.text")); // NOI18N

        declinationMeasure4Ss.setText(bundle.getString("MeasurePanel.declinationMeasure4Ss.text")); // NOI18N

        declinationDeclinationDd.setEditable(false);
        declinationDeclinationDd.setText(bundle.getString("MeasurePanel.declinationDeclinationField.text")); // NOI18N

        declinationDeclinationMm.setEditable(false);
        declinationDeclinationMm.setText(bundle.getString("DeclinationTab.declinationDeclinationMm.text")); // NOI18N

        declinationDeclinationSs.setEditable(false);
        declinationDeclinationSs.setText(bundle.getString("DeclinationTab.declinationDeclinationSs.text")); // NOI18N

        declinationMeridianDd.setText(bundle.getString("MeasurePanel.declinationMeridianField.text")); // NOI18N
        declinationMeridianDd.setEnabled(false);

        declinationMeridianMm.setText(bundle.getString("DeclinationTab.declinationMeridianMm.text")); // NOI18N
        declinationMeridianMm.setEnabled(false);

        declinationMeridianSs.setText(bundle.getString("DeclinationTab.declinationMeridianSs.text")); // NOI18N
        declinationMeridianSs.setEnabled(false);

        nowButton.setText(bundle.getString("DeclinationTab.nowButton.text")); // NOI18N
        nowButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                nowButtonActionPerformed(evt);
            }
        });

        jLabel8.setText(bundle.getString("DeclinationTab.jLabel8.text")); // NOI18N

        jLabel9.setText(bundle.getString("DeclinationTab.jLabel9.text")); // NOI18N

        jLabel10.setText(bundle.getString("DeclinationTab.jLabel10.text")); // NOI18N

        declinationAvgTime.setText(bundle.getString("MeasurePanel.declinationAvgTime.text")); // NOI18N

        declinationAvgTimeHours.setEditable(false);
        declinationAvgTimeHours.setText(bundle.getString("DeclinationTab.declinationAvgTimeHours.text")); // NOI18N
        declinationAvgTimeHours.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationAvgTimeMinutes.setEditable(false);
        declinationAvgTimeMinutes.setText(bundle.getString("DeclinationTab.declinationAvgTimeMinutes.text")); // NOI18N
        declinationAvgTimeMinutes.setPreferredSize(new java.awt.Dimension(24, 20));

        declinationAvgTimeSeconds.setEditable(false);
        declinationAvgTimeSeconds.setText(bundle.getString("DeclinationTab.declinationAvgTimeSeconds.text")); // NOI18N
        declinationAvgTimeSeconds.setPreferredSize(new java.awt.Dimension(24, 20));

        javax.swing.GroupLayout fieldsPanelLayout = new javax.swing.GroupLayout(fieldsPanel);
        fieldsPanel.setLayout(fieldsPanelLayout);
        fieldsPanelLayout.setHorizontalGroup(
            fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fieldsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jSeparator5)
                    .addGroup(fieldsPanelLayout.createSequentialGroup()
                        .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(fieldsPanelLayout.createSequentialGroup()
                                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addGroup(fieldsPanelLayout.createSequentialGroup()
                                        .addComponent(declinationMeasure1)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(declinationMeasure1Hours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(declinationMeasure1Minutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(declinationMeasure1Seconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(fieldsPanelLayout.createSequentialGroup()
                                        .addComponent(declinationMeasure2)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(declinationMeasure2Hours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(declinationMeasure2Minutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(declinationMeasure2Seconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(fieldsPanelLayout.createSequentialGroup()
                                        .addComponent(declinationMeasure3)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(declinationMeasure3Hours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(declinationMeasure3Minutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                        .addComponent(declinationMeasure3Seconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                                    .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fieldsPanelLayout.createSequentialGroup()
                                        .addComponent(jLabel10)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel9)
                                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                        .addComponent(jLabel8)))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED))
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, fieldsPanelLayout.createSequentialGroup()
                                .addComponent(declinationAvgTime)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(declinationAvgTimeHours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(declinationAvgTimeMinutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(declinationAvgTimeSeconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(6, 6, 6)))
                        .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(fieldsPanelLayout.createSequentialGroup()
                                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                    .addComponent(nowButton)
                                    .addComponent(declinationAvgDeclination)
                                    .addComponent(declinationMeridian))
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                    .addComponent(declinationMeasure1Dd, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(declinationDeclinationDd, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(declinationMeridianDd, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(declinationMeasure4Dd, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                                        .addComponent(declinationMeasure2Dd, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                        .addComponent(declinationMeasure3Dd, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))))
                            .addComponent(jLabel5, javax.swing.GroupLayout.Alignment.TRAILING))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(fieldsPanelLayout.createSequentialGroup()
                                .addComponent(declinationMeasure4Mm, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(declinationMeasure4Ss, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(fieldsPanelLayout.createSequentialGroup()
                                .addComponent(declinationMeasure3Mm, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(declinationMeasure3Ss, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(fieldsPanelLayout.createSequentialGroup()
                                .addComponent(declinationMeasure2Mm, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(declinationMeasure2Ss, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(fieldsPanelLayout.createSequentialGroup()
                                .addComponent(declinationMeasure1Mm, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(declinationMeasure1Ss, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(fieldsPanelLayout.createSequentialGroup()
                                .addComponent(declinationDeclinationMm, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(declinationDeclinationSs, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(fieldsPanelLayout.createSequentialGroup()
                                .addComponent(declinationMeridianMm, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(declinationMeridianSs, javax.swing.GroupLayout.PREFERRED_SIZE, 48, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(fieldsPanelLayout.createSequentialGroup()
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel7))))
                    .addGroup(fieldsPanelLayout.createSequentialGroup()
                        .addComponent(declinationMeasure4)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(declinationMeasure4Hours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(declinationMeasure4Minutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(declinationMeasure4Seconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(104, Short.MAX_VALUE))
        );
        fieldsPanelLayout.setVerticalGroup(
            fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(fieldsPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel5)
                    .addComponent(jLabel6)
                    .addComponent(jLabel7)
                    .addComponent(jLabel8)
                    .addComponent(jLabel9)
                    .addComponent(jLabel10))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(declinationMeasure1Hours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure1Minutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure1Seconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure1)
                    .addComponent(declinationMeasure1Dd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure1Mm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure1Ss, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(nowButton))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(declinationMeasure2Hours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure2Minutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure2Seconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure2)
                    .addComponent(declinationMeasure2Dd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure2Mm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure2Ss, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(declinationMeasure3Hours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure3Minutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure3Seconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure3)
                    .addComponent(declinationMeasure3Dd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure3Mm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure3Ss, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(declinationMeasure4Hours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure4Minutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure4Seconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure4)
                    .addComponent(declinationMeasure4Dd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure4Mm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeasure4Ss, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSeparator5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(declinationAvgDeclination)
                    .addComponent(declinationDeclinationDd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationDeclinationMm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationDeclinationSs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationAvgTime)
                    .addComponent(declinationAvgTimeHours, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationAvgTimeMinutes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationAvgTimeSeconds, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(fieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(declinationMeridian)
                    .addComponent(declinationMeridianDd, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeridianMm, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(declinationMeridianSs, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        declinationBackButton.setText(bundle.getString("MeasurePanel.declinationBackButton.text")); // NOI18N
        declinationBackButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                declinationBackButtonActionPerformed(evt);
            }
        });

        declinationNextButton.setText(bundle.getString("MeasurePanel.declinationNextButton.text")); // NOI18N
        declinationNextButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                declinationNextButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout backNextPanelLayout = new javax.swing.GroupLayout(backNextPanel);
        backNextPanel.setLayout(backNextPanelLayout);
        backNextPanelLayout.setHorizontalGroup(
            backNextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, backNextPanelLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(declinationBackButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(declinationNextButton)
                .addContainerGap())
        );
        backNextPanelLayout.setVerticalGroup(
            backNextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(backNextPanelLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(backNextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(declinationBackButton)
                    .addComponent(declinationNextButton))
                .addContainerGap())
        );

        javax.swing.GroupLayout declinationLayout = new javax.swing.GroupLayout(declination);
        declination.setLayout(declinationLayout);
        declinationLayout.setHorizontalGroup(
            declinationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(fieldsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(backNextPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        declinationLayout.setVerticalGroup(
            declinationLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(declinationLayout.createSequentialGroup()
                .addComponent(fieldsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 145, Short.MAX_VALUE)
                .addComponent(backNextPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 531, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(declination, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 393, Short.MAX_VALUE)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addComponent(declination, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void declinationNextButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_declinationNextButtonActionPerformed
        parent.moveToTab(MeasurePanel.INCLINATION_TAB);
    }//GEN-LAST:event_declinationNextButtonActionPerformed
    
    private void declinationBackButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_declinationBackButtonActionPerformed
        parent.moveToTab(MeasurePanel.MIRE_TAB);
    }//GEN-LAST:event_declinationBackButtonActionPerformed
    
    private void nowButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_nowButtonActionPerformed
        declinationMeasure1Hours.requestFocus();
        
        declinationMeasure1Hours.setText(new SimpleDateFormat("HH").format(new Date()));
        declinationMeasure1Minutes.setText(new SimpleDateFormat("mm").format(new Date()));
        declinationMeasure1Seconds.setText(new SimpleDateFormat("ss").format(new Date()));
        
        Session.getInstance().hasChanged(); //zmenili jsme datum
    }//GEN-LAST:event_nowButtonActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel backNextPanel;
    private javax.swing.JPanel declination;
    private javax.swing.JLabel declinationAvgDeclination;
    private javax.swing.JLabel declinationAvgTime;
    private javax.swing.JTextField declinationAvgTimeHours;
    private javax.swing.JTextField declinationAvgTimeMinutes;
    private javax.swing.JTextField declinationAvgTimeSeconds;
    private javax.swing.JButton declinationBackButton;
    private javax.swing.JTextField declinationDeclinationDd;
    private javax.swing.JTextField declinationDeclinationMm;
    private javax.swing.JTextField declinationDeclinationSs;
    private javax.swing.JLabel declinationMeasure1;
    private javax.swing.JTextField declinationMeasure1Dd;
    private javax.swing.JTextField declinationMeasure1Hours;
    private javax.swing.JTextField declinationMeasure1Minutes;
    private javax.swing.JTextField declinationMeasure1Mm;
    private javax.swing.JTextField declinationMeasure1Seconds;
    private javax.swing.JTextField declinationMeasure1Ss;
    private javax.swing.JLabel declinationMeasure2;
    private javax.swing.JTextField declinationMeasure2Dd;
    private javax.swing.JTextField declinationMeasure2Hours;
    private javax.swing.JTextField declinationMeasure2Minutes;
    private javax.swing.JTextField declinationMeasure2Mm;
    private javax.swing.JTextField declinationMeasure2Seconds;
    private javax.swing.JTextField declinationMeasure2Ss;
    private javax.swing.JLabel declinationMeasure3;
    private javax.swing.JTextField declinationMeasure3Dd;
    private javax.swing.JTextField declinationMeasure3Hours;
    private javax.swing.JTextField declinationMeasure3Minutes;
    private javax.swing.JTextField declinationMeasure3Mm;
    private javax.swing.JTextField declinationMeasure3Seconds;
    private javax.swing.JTextField declinationMeasure3Ss;
    private javax.swing.JLabel declinationMeasure4;
    private javax.swing.JTextField declinationMeasure4Dd;
    private javax.swing.JTextField declinationMeasure4Hours;
    private javax.swing.JTextField declinationMeasure4Minutes;
    private javax.swing.JTextField declinationMeasure4Mm;
    private javax.swing.JTextField declinationMeasure4Seconds;
    private javax.swing.JTextField declinationMeasure4Ss;
    private javax.swing.JLabel declinationMeridian;
    private javax.swing.JTextField declinationMeridianDd;
    private javax.swing.JTextField declinationMeridianMm;
    private javax.swing.JTextField declinationMeridianSs;
    private javax.swing.JButton declinationNextButton;
    private javax.swing.JPanel fieldsPanel;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JSeparator jSeparator5;
    private javax.swing.JButton nowButton;
    // End of variables declaration//GEN-END:variables

    @Override
    public void clearFields() {
        clearField(declinationAvgTimeHours);
        clearField(declinationAvgTimeMinutes);
        clearField(declinationAvgTimeSeconds);
        clearField(declinationDeclinationDd);
        clearField(declinationDeclinationMm);
        clearField(declinationDeclinationSs);
        clearField(declinationMeasure1Dd);
        clearField(declinationMeasure1Hours);
        clearField(declinationMeasure1Minutes);
        clearField(declinationMeasure1Mm);
        clearField(declinationMeasure1Seconds);
        clearField(declinationMeasure1Ss);
        clearField(declinationMeasure2Dd);
        clearField(declinationMeasure2Hours);
        clearField(declinationMeasure2Minutes);
        clearField(declinationMeasure2Mm);
        clearField(declinationMeasure2Seconds);
        clearField(declinationMeasure2Ss);
        clearField(declinationMeasure3Dd);
        clearField(declinationMeasure3Hours);
        clearField(declinationMeasure3Minutes);
        clearField(declinationMeasure3Mm);
        clearField(declinationMeasure3Seconds);
        clearField(declinationMeasure3Ss);
        clearField(declinationMeasure4Dd);
        clearField(declinationMeasure4Hours);
        clearField(declinationMeasure4Minutes);
        clearField(declinationMeasure4Mm);
        clearField(declinationMeasure4Seconds);
        clearField(declinationMeasure4Ss);
        clearField(declinationMeridianDd);
        clearField(declinationMeridianMm);
        clearField(declinationMeridianSs);
    }
    
    private void fill() {
        fillTab(0, declinationMeasure1Hours, declinationMeasure1Minutes, declinationMeasure1Seconds, nowButton, declinationMeasure1Dd, declinationMeasure1Mm, declinationMeasure1Ss);
        fillTab(1, declinationMeasure2Hours, declinationMeasure2Minutes, declinationMeasure2Seconds, declinationMeasure2Dd, declinationMeasure2Mm, declinationMeasure2Ss);
        fillTab(2, declinationMeasure3Hours, declinationMeasure3Minutes, declinationMeasure3Seconds, declinationMeasure3Dd, declinationMeasure3Mm, declinationMeasure3Ss);
        fillTab(3, declinationMeasure4Hours, declinationMeasure4Minutes, declinationMeasure4Seconds, declinationMeasure4Dd, declinationMeasure4Mm, declinationMeasure4Ss);
        //fillTab(4, declinationAvgTimeHours, declinationAvgTimeMinutes, declinationAvgTimeSeconds, declinationDeclinationDd, declinationDeclinationMm, declinationDeclinationSs);
//        fillTab(4, declinationMeridianDd, declinationMeridianMm, declinationMeridianSs);

        fillTab(4, declinationBackButton, declinationNextButton);
    }
}
